Getting Started with Quarto

RUM-UMC meeting

2024-10-23

What is Quarto?

Quarto is a free, open-source scientific and technical publishing system.

Quarto allows you to seamlessly combine executable R code, its output, and text in a single document.

These documents can be converted to multiple static and dynamic output formats, including PDF (.pdf), Word (.docx), and HTML (.html).

The benefit of a well-prepared Quarto document is full reproducibility.

A schematic representing the multi-language input (e.g. Python, R, Observable, Julia) and multi-format output (e.g. PDF, html, Word documents, and more) versatility of Quarto.

Artwork by @allison_horst

Why Quarto?

Full reproducibility also means

  • flexibility to add data and recompile
  • no need to change all occurrences in a document
  • easily fix mistakes made during analysis…
A judge’s desk labeled 'Reproducibility' with a witness stand right next to it. On the witness stand is a smiling and confident R Markdown document pointing at some lines of code on itself. A fuzzy monster lawyer in a polka-dot tie stands proudly saying 'Nothing further!' The judge (also a cute fuzzy monster) is smiling with their hands raised in celebration of reproducible work.

Artwork by @allison_horst

Quarto Exercises

Exercise 1

Play around with the different options in the chunk with the code for the table, and re-Render to see what each option does to the output.

What happens if you use eval: false and echo: false?

What is the difference between this and include: false?

Solution

Create a chunk with eval: false, echo: false

then create another chunk with include: false to compare.

eval: false, echo: false will neither run the code in the chunk, nor show the code in the rendered document. The code chunk essentially doesn’t exist in the rendered document…

…whereas include: false will run the code and store the output for later use.

See a comprehensive list of chunk options here